home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 34.zip / BS1 part 34 / FredFish PD 318.adf / Lhwarp / Lhwarp.doc < prev    next >
Text File  |  1990-02-14  |  12KB  |  299 lines

  1.  
  2.                                    LHWARP 1.21
  3.                                 6th January, 1990
  4.  
  5.                            A disk tracker for the Amiga
  6.  
  7.                             Written by Jonathan Forbes
  8.  
  9.    What is Lhwarp?
  10.  
  11.    (Pronounced L-H-WARP)
  12.  
  13.    Lhwarp is a program which will read tracks directly from your floppy disk,
  14. compress them, and output them to a file.  The advantages of using Lhwarp are:
  15.  
  16.    o The entire disk structure, including the boot block, is preserved.
  17.  
  18.    o Lhwarp will always produce a smaller output file than ARC, ZOO or WARP.
  19.       (note: this is only true when the default compression algorithm is used)
  20.  
  21.    o Lhwarp will only archive sectors which contain data, by using the disk's
  22.         bitmap (however, Lhwarp will gladly compress every single sector on
  23.         the disk, if you wish.)
  24.  
  25.    o Using Lhwarp is much less hassle than archiving each and every file
  26.         individually.
  27.  
  28.    o The bootblock of any disk being either read or written is displayed, so
  29.         that bootblock viruses can easily be found.
  30.  
  31.    Lhwarp will produce files much smaller than those produced by Warp, due to
  32. the fact that Lhwarp uses a more efficient compression algorithm (Adaptive
  33. Huffman Encoding); the same algorithm used in LHARC.  Typically, an Lhwarp
  34. file will be 80% of the size of an equivalent Warp file, resulting in quite
  35. reasonable hard drive space savings.
  36.  
  37.    In addition, Lhwarp will only archive sectors which contain data; deleted
  38. information is not archived (unless you explicity request this to be done.)
  39. When compressing or decompressing data, sectors which contain data are marked
  40. with a '.' character, while sectors which do not contain data are marked with
  41. a '_' character.  If the -m option is specified, all sectors will be marked
  42. with '.' automatically.
  43.  
  44.    Lhwarp's main (and perhaps only) disadvantage is that compression time is
  45. very large; it can take from 20 to 25 minutes to compress an entire disk
  46. (80 tracks.)  There is not too much which can be done about this; you have to
  47. pay a price for the extra power.
  48.  
  49.    However, this is not as bad as it may seem; a disk only has to be Lhwarp'd
  50. once; after Lhwarp'ing, the output file will be transferred via a modem,  from
  51. BBS to BBS.  Because the file will be that much smaller than an equivalent
  52. file produced by Warp, the file will take less time to transfer, resulting in a
  53. lower phone bill.  And, as mentioned before, it will occopy less space on the
  54. destination system.
  55.  
  56.  
  57.    Algorithms
  58.  
  59.    For those who simply must have a faster compression rate, Lhwarp provides
  60. two additional compression algorithms; squeezing and vaporising (the latter is
  61. the 14 bit version of UNIX Compress.)  Both are much faster than the LHARC
  62. Adaptive Huffman Encoding algorithm (called "freezing.")  However, neither of
  63. them comes close to the compression ratio of freezing.
  64.  
  65.    Even so, the huge speed increase and reasonable compression rates should
  66. appeal to those who are less concerned with compression efficiency, and more
  67. concerned with speed.
  68.  
  69.    Freezing remains the default compression mode.  Using the -c switch will
  70. cause the disk to be vaporised (not literally), while the -s switch will cause
  71. the disk to be squeezed.  The -b option will cause each individual track to be
  72. either vaporised or squeezed, depending on which produces the smallest output.
  73.  
  74.    The -q option will cause Lhwarp to use its fastest and most reasonable
  75. algorithm on the disk.  Currently, this is squeezing.  Admittedly, vaporising
  76. is faster, but vaporising often generates track output which is actually
  77. larger than the track itself, and squeezing is almost as fast (certainly it's
  78. faster than freezing.)
  79.  
  80.    The most recommended option for speed, is the -b option, to select both
  81. algorithms; compression time is only a few minutes longer than that of one of
  82. the algorithms, and different algorithms sometimes work better for different
  83. disks.
  84.  
  85.    You cannot currently combine freezing with any other algorithm; this is for
  86. your own benefit; I have yet to see freezing beaten by vaporising or squeezing
  87. for any one track, ever!  However, if you find that vaporising and squeezing
  88. frequently do compress tracks more efficiently, please inform me.
  89.  
  90.    To compress the NewTek DYNAMIC HI-RES demo disk:
  91.  
  92.    Compression               Size     Time (approximate)
  93.    -----------             --------   ------------------
  94.    Freezing                 671630    20:00 minutes
  95.    Vaporising/Squeezing     770722    10:30 minutes
  96.    Squeezing                803714    07:30 minutes
  97.    Vaporising               869515    06:30 minutes
  98.    Warp program             796665    15:00 minutes
  99.  
  100.    At this point in time, Lhwarp does not check to see if the output for a
  101. track is larger than the input; this is why vaporising produced such a huge
  102. file; many tracks compressed from 11k to 13k.  This will be corrected in a
  103. future version.
  104.  
  105.  
  106.    Viewing
  107.  
  108.    Lhwarp also supports viewing; you may see how Lhwarp has compressed a disk
  109. (which tracks are contained in the file, which algorithm was used to compress
  110. them, the source and destination lengths of each track, the number of sectors
  111. compressed, and the sector map of each track.)  The viewing option will also
  112. display any attached text.
  113.  
  114.    After any attached text is displayed, you must press return; this was
  115. implemented so that the displaying of the boot block won't scroll the text off
  116. the screen.
  117.  
  118.  
  119.    More Information
  120.  
  121.    Lhwarp output files have the suffix ".LHW".  If the filename you give
  122. Lhwarp does not end in ".LHW", Lhwarp will append ".LHW" to it.  Please leave
  123. the suffix alone, and don't change it to ".WRP".
  124.  
  125.    The Adaptive Huffman Encoding algorithm was originally coded by Haruyasu
  126. Yoshizaki, and is the same algorithm used in LHARC 1.13c.  When the more
  127. efficient LHARC 2.0 arrives from Japan, that algorithm will instead be used.
  128.  
  129.    Lhwarp was compiled and very heavily optimised under Lattice C 5.04.  Even
  130. though Lattice produces very fast code, Lhwarp needs all the speed it can get.
  131. I have rewritten a few of Lhwarp's compression functions in assembly language,
  132. and performance has improved significantly.
  133.  
  134.    Nevertheless, the Lzhuf routines, which are now a mixture of Lattice C 5.04
  135. code and assembly language, are much faster than those in either Amiga Lharc,
  136. or the previous versions of Lhwarp.  When compressing an arbitrary 40k file:
  137.  
  138.                        Encode time(s)        Decode time(s)
  139.    Lharc                    60                    15
  140.    Lhwarp 1.03              55                    13
  141.    Lhwarp 1.10              47                    11
  142.    Lhwarp 1.11              39                    11
  143.    Lhwarp 1.20              39                    10
  144.    Lhwarp 1.21              39                    10
  145.  
  146.  
  147.    Parameters
  148.  
  149.    To view Lhwarp's parameters, type "Lhwarp"; they are included within the
  150. program.  You will be presented with:
  151.  
  152. Usage: LHWARP <Command> [-option] <Unit> <Filename> <Start> <End> <TextFile>
  153.  
  154. <Command>    Read or Write
  155.                -m: ignore bitmap
  156.                -q: quick compression
  157.                -s: squeeze
  158.                -c: compress-14 (vaporise)
  159.                -b: both squeeze/vaporise
  160.                -v: view output file
  161. <Unit>       Drive number (0 for internal, 1 ... 3 for external)
  162. <Filename>   Output|Input filename
  163. <StartTrack> Track number (0 ... 79) [valid only in read mode]
  164. <EndTrack>   Track number (0 ... 79) [valid only in read mode]
  165. <TextTFile>  Append text in <TextFile> to output file [optional]
  166.  
  167.    Examples are:
  168.  
  169.    a) Lhwarp READ 0 mydisk 0 79
  170.  
  171.       This will read tracks 0 to 79 of the disk in drive 0 (i.e. the entire
  172. disk), and will output the result to "mydisk.lhw"  Only sectors which contain
  173. data will be archived.
  174.  
  175.  
  176.    b) Lhwarp READ 0 mydisk 0 79 mytext
  177.  
  178.       This will read tracks 0 to 79 of the disk in drive 0 (i.e. the entire
  179. disk), and will output the result to "mydisk.lhw".  Only sectors which contain
  180. data will be archived.  The text from the file "mytext" will be imported to
  181. the output file.  Any text stored in the output file will be displayed when
  182. the disk is unarchived.
  183.  
  184.  
  185.    c) Lhwarp -m READ 0 mydisk 0 79
  186.  
  187.       This will read tracks 0 to 79 of the disk in drive 0 (i.e. the entire
  188. disk), and will output the result to "mydisk.lhw".  All sectors will be
  189. archived, regardless of whether or not they contain data; the disk's bitmap
  190. is ignored with the '-m' option.
  191.  
  192.  
  193.    d) Lhwarp WRITE 1 mydisk
  194.  
  195.       This will output all tracks stored in mydisk.lhw to drive 1.  If any
  196. text was in the output file, it will be displayed.
  197.  
  198.  
  199.    e) Lhwarp -c READ 0 mydisk 0 79
  200.  
  201.       Same as a), except that the disk will be "vaporised."
  202.  
  203.  
  204.    f) Lhwarp -s READ 0 mydisk 0 79
  205.  
  206.       Same as a), except that the disk will be "squeezed."
  207.  
  208.  
  209.    g) Lhwarp -b READ 0 mydisk 0 79
  210.  
  211.       Same as a), except that tracks will be either squeezed or vaporisied,
  212.       depending on which is more efficient.
  213.  
  214.  
  215.    h) Lhwarp -m -c READ 0 mydisk 0 79
  216.  
  217.       Same as e), except that the bitmap will be ignored.
  218.  
  219.  
  220.    i) Lhwarp -v mydisk
  221.  
  222.       View composition of the file MYDISK.LHW.
  223.  
  224.  
  225.    Please note that you must combine options in the format of:
  226.        'Lhwarp -a -b -c ...'
  227.    Not:
  228.        'Lhwarp -abc ...'
  229.  
  230.    The latter may have unpredictable results (most probably all options but
  231. '-a' will be ignored.)
  232.  
  233.  
  234.    Virus detection
  235.  
  236.    Some people have complained about Warp in that it aids the spreading of
  237. boot block viruses.  It is for this reason that Lhwarp will display the
  238. bootblock of any disk it reads or writes, so that one can see what is being
  239. Lhwarp'd.  Any non-standard looking bootblock should be viewed with suspicion.
  240.  
  241.    If you see a non-standard bootblock in read mode, this means that the disk
  242. you are reading from might possibly contain a virus.  If you see this in write
  243. mode, it means that the file you are writing out to your disk may contain a
  244. virus.  In either case, you should load a virus checker to make sure (such as
  245. VirusX 4.0)
  246.  
  247.  
  248.    Specifications
  249.  
  250.    Lhwarp uses ETD_READ and ETD_FORMAT to read/write directly from/to the
  251. trackdisk.device.  The 16 bytes of label information for each sector are saved
  252. in the output file.  A 32-bit CRC protects data integrity.
  253.  
  254.  
  255.    Future Possibilities
  256.  
  257.    o Support for raw track reads and writes
  258.    o Merging output files
  259.    o Mix raw/normal tracks in a single file
  260.  
  261.  
  262.    Acknowledgements
  263.  
  264.    Huffman routines   - Haruyasu Yoshizaki (lzhuf.c, v1.13c)
  265.    Compress           - S.Thomas, J.McKie, S.Davies, K.Turkowski, J.Woods,
  266.                            and J.Orost (compress.c)
  267.    Squeezing          - William Swan (sq.c/usq.c)
  268.    Bitmap information - Leo Schwab (diskmap2.c)
  269.  
  270.  
  271.    This Program
  272.  
  273.    Lhwarp is a freely distributable, copyrighted piece of software.  You do
  274. not have to pay money to use it, and may upload it wherever you choose, but
  275. you are not allowed to sell Lhwarp for profit, or include Lhwarp on a disk
  276. which is sold for profit, without the author's (Jonathan Forbes) permission.
  277.  
  278.    I can be contacted at 416-927-7844 (voice.)
  279.  
  280.  
  281.    Disclaimer
  282.  
  283.    I am in no way responsible for anything this program does; you are using
  284. it entirely at your own risk, so if you are kidnapped and held hostage by
  285. Libyan terrorists, don't blame me!
  286.  
  287.  
  288.    Important note
  289.  
  290.    The STACK SIZE requirements have increased again, slightly -15k or so
  291. should be adequate.  This will be corrected in a future version.
  292.  
  293.  
  294.    Conclusion
  295.  
  296.    So there you have it; Lhwarp is faster and more efficent than Warp, and
  297. Lhwarp is being updated; Warp isn't!  All that's missing is the support for
  298. raw track reads/writes, which will be implemented as soon as I find out how.
  299.